const { Schema, SchemaTypes, model } = require("mongoose")

const HeroSchema = new Schema({
    name: { type: String },
    avatar: { type: String },
    title: { type: String },
    categories: [{ type: SchemaTypes.ObjectId, ref: 'Category' }],
    scores: {
        difficult: { type: Number },
        skills: { type: Number },
        attack: { type: Number },
        survive: { type: Number },
    },
    skills: [{
        icon: { type: String },
        name: { type: String },
        description: { type: String },
        tips: { type: String }
    }],
    items1: [{ type: SchemaTypes.ObjectId, ref: 'Item' }], //顺风出装
    items2: [{ type: SchemaTypes.ObjectId, ref: 'Item' }], //逆风出装
    usegeTips: { type: String },
    battleTips: { type: String },
    teamTips: { type: String },
    partners: [{
        hero: { type: SchemaTypes.ObjectId, ref: 'Hero' },
        description: { type: String }
    }]
})

module.exports = model("Hero", HeroSchema)